﻿Imports System.Data.SqlClient
Public Class Reportes
    Inherits Conexion
    Dim cmd As New SqlCommand
    'Funciones


    Public Function mostrar(ByVal reg As Movimientos) As DataTable
        Try
            conectar()
            cmd = New SqlCommand("reporteEntradaMP")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@idmovi", reg.pID_T_Documento)
            Dim da As SqlDataReader = cmd.ExecuteReader
            Dim dt As New DataTable
            dt.Load(da)
            If dt.Rows.Count > 0 Then
                Return dt
            Else

                Return Nothing
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Advertencia", MessageBoxButtons.OK,
                          MessageBoxIcon.Warning)
            Return Nothing
        Finally
            desconectar()
        End Try
    End Function
End Class
